import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);

// 查看生成的合同图片
const saveImg = () => import("../components/commons/saveImg.vue");
import login from "@/views/login/index";

import companyName from "@/views/companyName/index"

import Rentout from "@/views/PersonalCar/Rentout/index";
import Vehicleinquiry from "@/views/PersonalCar/Vehicleinquiry/index";
import VehicleinquiryDetil from "@/views/PersonalCar/Vehicleinquiry/detil";
import LeaseagreementCompanyPage from "@/views/PersonalCar/Leaseagreement/companypage"
import LeaseagreementAgreementpage from "@/views/PersonalCar/Leaseagreement/agreementpage"
import Leaseagreement from "@/views/PersonalCar/Leaseagreement/index";
import LeaseagreementDetil from "@/views/PersonalCar/Leaseagreement/detil";
import Incomeinquiry from "@/views/PersonalCar/Incomeinquiry/index";
import IncomeinquiryDetil from "@/views//PersonalCar/Incomeinquiry/detil";

import indexx from "../views/index/index.vue";

// 企业信息 企业用车 租赁合同 账单管理
const enterpriseInfo = () =>
  import("../views/enterpriseCar/enterpriseInfo.vue");
const enterpriseDetail = () =>
  import("../views/enterpriseCar/enterpriseDetail.vue");

import enterpriseCarCar from "@/views/enterpriseCar/car/index";
import enterpriseCarCarList from "@/views/enterpriseCar/car/list";
import enterpriseCarCarDetail from "@/views/enterpriseCar/car/detail";
import enterpriseCarContract from "@/views/enterpriseCar/contract/index";
import enterpriseCarContractList from "@/views/enterpriseCar/contract/list";
import enterpriseCarContractDetail from "@/views/enterpriseCar/contract/detail";

import enterpriseCarCard from "@/views/enterpriseCar/card/index";
import enterpriseCarCardList from "@/views/enterpriseCar/card/list";
import enterpriseCarCardDetail from "@/views/enterpriseCar/card/detail";
import enterpriseCarBill from "@/views/enterpriseCar/bill/index";
import enterpriseCarBillDetail from "@/views/enterpriseCar/bill/detail";
import platformService from "@/views/platformService/index";

export default new Router({
  routes: [
    {
      path: "/",
      redirect: "/indexx",
      meta: {
        auth: false // 如果此路由需要微信授权请设置为true,默认为false
      }
    },
    {
      path: "/indexx",
      name: "indexx",
      component: indexx,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "车企惠"
      }
    },
    {
      path: "/companyName",
      name: "companyName",
      component: companyName,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "公司"
      }
    },
    //个人车辆结束
    {
      path: "/PersonalCar/Rentout",
      name: "Rentout",
      component: Rentout,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "私车出租"
      }
    },
    {
      path: "/PersonalCar/Vehicleinquiry",
      name: "Vehicleinquiry",
      component: Vehicleinquiry,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "车辆查询"
      }
    },
    {
      path: "/PersonalCar/Vehicleinquiry/detil",
      name: "VehicleinquiryDetil",
      component: VehicleinquiryDetil,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "车辆查询详情"
      }
    },
    {
      path: "/PersonalCar/LeaseagreementCompanyPage",
      name: "LeaseagreementCompanyPage",
      component: LeaseagreementCompanyPage,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "租赁协议公司页"
      }
    },
    {
      path: "/PersonalCar/LeaseagreementAgreementpage",
      name: "LeaseagreementAgreementpage",
      component: LeaseagreementAgreementpage,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "租赁协议协议页"
      }
    },
    {
      path: "/PersonalCar/Leaseagreement",
      name: "Leaseagreement",
      component: Leaseagreement,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "租赁协议"
      }
    },
    {
      path: "/PersonalCar/LeaseagreementDetil",
      name: "LeaseagreementDetil",
      component: LeaseagreementDetil,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "租赁协议详情"
      }
    },
    {
      path: "/PersonalCar/Incomeinquiry",
      name: "Incomeinquiry",
      component: Incomeinquiry,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "收益查询"
      }
    },
    {
      path: "/PersonalCar/Incomeinquiry/detil",
      name: "IncomeinquiryDetil",
      component: IncomeinquiryDetil,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "收益查询详情"
      }
    },
    //个人车辆结束
    //公司用车开始
    {
      path: "/enterprise/info",
      name: "enterpriseInfo",
      component: enterpriseInfo,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "企业信息"
      }
    },
    {
      path: "/enterprise/detail",
      name: "enterpriseDetail",
      component: enterpriseDetail,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "信息详情"
      }
    },
    {
      path: "/save/img",
      name: "saveImg",
      component: saveImg,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "保存图片"
      }
    },

    {
      path: "/enterpriseCar/car",
      name: "enterpriseCarCar",
      component: enterpriseCarCar,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "用车管理公司列表"
      }
    },
    {
      path: "/enterpriseCar/car/list",
      name: "enterpriseCarCarList",
      component: enterpriseCarCarList,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "用车管理车辆列表"
      }
    },
    {
      path: "/enterpriseCar/car/detail",
      name: "enterpriseCarCarDetail",
      component: enterpriseCarCarDetail,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "用车管理用车详情"
      }
    },
    {
      path: "/enterpriseCar/contract",
      name: "enterpriseCarContract",
      component: enterpriseCarContract,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "合同确认公司页"
      }
    },
    {
      path: "/enterpriseCar/contract/list",
      name: "enterpriseCarContractList",
      component: enterpriseCarContractList,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "合同确认合同页"
      }
    },
    {
      path: "/enterpriseCar/contract/detail",
      name: "enterpriseCarContractDetail",
      component: enterpriseCarContractDetail,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "合同确认确认页"
      }
    },

    {
      path: "/enterpriseCar/card",
      name: "enterpriseCarCard",
      component: enterpriseCarCard,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "公司列表"
      }
    },
    {
      path: "/enterpriseCar/card/list",
      name: "enterpriseCarCardList",
      component: enterpriseCarCardList,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "公司加油卡列表"
      }
    },
    {
      path: "/enterpriseCar/card/detail",
      name: "enterpriseCarCardDetail",
      component: enterpriseCarCardDetail,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "公司加油卡详情编辑"
      }
    },
    {
      path: "/enterpriseCar/bill",
      name: "enterpriseCarBill",
      component: enterpriseCarBill,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "历史账单"
      }
    },
    {
      path: "/enterpriseCar/bill/detail",
      name: "enterpriseCarBillDetail",
      component: enterpriseCarBillDetail,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "账单明细"
      }
    },
    //公司用车结束
    //平台服务开始
    {
      path: "/platformService",
      name: "platformService",
      component: platformService,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "平台服务"
      }
    },
    //平台服务结束
    {
      path: "/login",
      name: "login",
      component: login,
      meta: {
        auth: false, // 如果此路由需要微信授权请设置为true,默认为false
        title: "注册/登录"
      }
    }
  ]
});
